﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using BL.Client.BudgetManageBL;

namespace UI.BudgetManage.ChildForm.BudgetPay
{
    public partial class CardIndentify : Form
    {
        BudgetManageServerice BMS;
        public CardIndentify()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string department_sn = tbSN.Text.Trim();
            string user_password = tbPassword.Text.Trim();
            if (!this.BMS.UserIndentifyBySN(department_sn, user_password))
            {
                MessageBox.Show("密码不正确！");
                return;
            }
            string user_id = this.BMS.GetUserIdBySN(department_sn, user_password);
            BorrowPayBack ibpwin = new BorrowPayBack(user_id);
            ibpwin.MdiParent = this.MdiParent;
            ibpwin.Show();
            this.Close();
        }

        private void CardIndentify_Load(object sender, EventArgs e)
        {
            this.BMS = ((BMMain)this.MdiParent).BMS;
        }

        private void btClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}